package com.spc.car.data.domain.log.po;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.spc.car.data.annotation.Skip;
import com.spc.car.data.util.QueryUtil;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;

@Data
public class ProjectOperationQueryPO {
    @Skip
    @Min(value =  0)
    private Integer page = 0;

    @Skip
    @Range(min = 1, max = 30)
    private Integer pageSize = 10;

    private String projectCode;

    private String projectTenderingCode;

    private String projectTenderingSectionCode;

    public Wrapper toWrapper() {
        QueryWrapper wrapper = QueryUtil.toWrapper(this);
        wrapper.orderByDesc("create_time");
        return wrapper;
    }
}
